package com.jrx.anytxn.customer.dto.creditinfo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jrx.anytxn.customer.entity.CmCustomerLimitInfo;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 授信信息的实体类
 * @author Qingyao Xing
 * @date 2019/7/18 11:48
 */
public class CreditInfoRes  implements Serializable {

    private static final long serialVersionUID = 4112361925744037264L;
    /**
     * 产品ID
     */
    @NotBlank(message = "产品ID不能为空")
    @Size(max = 32,message = "产品ID长度不能大于32位字符")
    private String productId;

    /**
     * 授信流水号
     */
    private String seqNo;
    /**
     * 合同号
     */
    private String contractNumber;
    /**
     * 授信金额
     */
    private BigDecimal creditLimit;

    /**
     * 当前可用额度
     */
    private BigDecimal availCreditLimit;

    /**
     * 已使用额度
     * 表字段:limit_used
     */
    private BigDecimal limitUsed;

    /**
     * 额度生效日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date effectiveDate;

    /**
     * 额度失效日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date expiryDate;

    /**
     * 产品类型
     */
    @NotBlank(message = "产品类型不能为空")
    private String productType;

    /**
     * 額度信息就节点limitId
     */
    private String limitId;

    /**
     * 获取状态	0 = 失效，1正常，2=冻结
     * @return limitStatus String
     */
    @ApiModelProperty(value="状态 0= 失效，1正常，2=冻结",example="1")
    private String limitStatus;

    private CmCustomerLimitInfo cmCustomerLimitInfo;

    /**
     * 	年利率
     */
    private BigDecimal yearRate;

    public String getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }

    public String getContractNumber() {
        return contractNumber;
    }

    public void setContractNumber(String contractNumber) {
        this.contractNumber = contractNumber;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public BigDecimal getCreditLimit() {
        return creditLimit;
    }

    public void setCreditLimit(BigDecimal creditLimit) {
        this.creditLimit = creditLimit;
    }

    public Date getEffectiveDate() {
        return effectiveDate;
    }

    public void setEffectiveDate(Date effectiveDate) {
        this.effectiveDate = effectiveDate;
    }

    public Date getExpiryDate() {
        return expiryDate;
    }

    public void setExpiryDate(Date expiryDate) {
        this.expiryDate = expiryDate;
    }

    public BigDecimal getAvailCreditLimit() {
        return availCreditLimit;
    }

    public void setAvailCreditLimit(BigDecimal availCreditLimit) {
        this.availCreditLimit = availCreditLimit;
    }

    public String getProductType() {
        return productType;
    }

    public void setProductType(String productType) {
        this.productType = productType;
    }

    public String getLimitId() {
        return limitId;
    }

    public void setLimitId(String limitId) {
        this.limitId = limitId;
    }

    public String getLimitStatus() {
        return limitStatus;
    }

    public void setLimitStatus(String limitStatus) {
        this.limitStatus = limitStatus;
    }

    public CmCustomerLimitInfo getCmCustomerLimitInfo() {
        return cmCustomerLimitInfo;
    }

    public void setCmCustomerLimitInfo(CmCustomerLimitInfo cmCustomerLimitInfo) {
        this.cmCustomerLimitInfo = cmCustomerLimitInfo;
    }

    @Override
    public String toString() {
        return "CreditInfoRes{" +
                "productId='" + productId + '\'' +
                ", seqNo='" + seqNo + '\'' +
                ", contractNumber='" + contractNumber + '\'' +
                ", creditLimit=" + creditLimit +
                ", availCreditLimit=" + availCreditLimit +
                ", effectiveDate=" + effectiveDate +
                ", expiryDate=" + expiryDate +
                ", productType='" + productType + '\'' +
                ", limitId='" + limitId + '\'' +
                ", limitStatus='" + limitStatus + '\'' +
                ", cmCustomerLimitInfo=" + cmCustomerLimitInfo +
                '}';
    }

    /**
     * 获取 已使用额度      表字段:limit_used
     *
     * @return limitUsed 已使用额度      表字段:limit_used
     */
    public BigDecimal getLimitUsed() {
        return this.limitUsed;
    }

    /**
     * 设置 已使用额度      表字段:limit_used
     *
     * @param limitUsed 已使用额度      表字段:limit_used
     */
    public void setLimitUsed(BigDecimal limitUsed) {
        this.limitUsed = limitUsed;
    }

    public BigDecimal getYearRate() { return yearRate; }

    public void setYearRate(BigDecimal yearRate) { this.yearRate = yearRate; }
}
